package xyz.kongbai121.shop.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import xyz.kongbai121.common.to.mq.SeckillOrderTo;
import xyz.kongbai121.common.utils.PageUtils;
import xyz.kongbai121.shop.order.entity.OrderEntity;
import xyz.kongbai121.shop.order.vo.OrderConfirmVo;
import xyz.kongbai121.shop.order.vo.OrderSubmitVo;
import xyz.kongbai121.shop.order.vo.PayVo;
import xyz.kongbai121.shop.order.vo.SubmitOrderRespVo;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author kongbai121
 * @email kongbai121@gmail.com
 * @date 2021-07-18 17:57:49
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 订单确认页返回需要用到的数据
     * @return
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    SubmitOrderRespVo submitOrder(OrderSubmitVo vo);

    OrderEntity getOrderByOrderSn(String orderSn);

    void closeOrder(OrderEntity entity);

    PayVo getOrderPay(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);

    void handlePayResult(String orderSn);

    void createSeckillOrder(SeckillOrderTo to);
}

